// 打包图形化分析工具，正式打包前注释掉
const BundleAnalyzerPlugin = require("webpack-bundle-analyzer").BundleAnalyzerPlugin;

// 自动复制文件插件
const CopyWebpackPlugin = require('copy-webpack-plugin')

module.exports = {
  // 打包图形化分析工具，正式打包前注释掉
  chainWebpack: config => {
    config
      .plugin('webpack-bundle-analyzer')
      .use(BundleAnalyzerPlugin)
  },

  // easyPlayer 打包自动拷贝资源配置配置文件
  configureWebpack: {
    plugins: [
      new CopyWebpackPlugin([
        {
          from: 'node_modules/@easydarwin/easyplayer/dist/component/EasyPlayer.wasm',
          to: './libs/EasyPlayer/'
        },
        {
          from: 'node_modules/@easydarwin/easyplayer/dist/component/crossdomain.xml',
          to: './libs/EasyPlayer/'
        },
        {
          from: 'node_modules/@easydarwin/easyplayer/dist/component/EasyPlayer-lib.min.js',
          to: './libs/EasyPlayer/'
        },
        
        {
          from: 'node_modules/@easydarwin/easywasmplayer/EasyWasmPlayer.js',
          to: './'
        },
        {
          from: 'node_modules/@easydarwin/easywasmplayer/libDecoder.wasm',
          to: './'
        }
      ])
    ]
  }
}






